import json
import time
import requests

from PyQt5.QtCore import QThread, pyqtSignal


class EmergencyThread(QThread):
    load_status = pyqtSignal(dict)
    def __init__(self, url):
        super().__init__()
        self.url = url
    
    def run(self) -> None:
        while(True):
            response = requests.get(self.url)
            data = json.loads(response.text).get('data')
            self.load_status.emit(data)
            time.sleep(5)


        
    